import { loadPlugin, loadPluginFn } from '../../app/config/loadplugin.config.js';
import getCompanyList from '../../company/resolves/getCompanyList.js';

import indexHtml from 'ngtemplate!html!../../../tpls/user/index.html';
import loginHtml from 'ngtemplate!html!../../../tpls/user/login.html';
import findpassHtml from 'ngtemplate!html!../../../tpls/user/findpass.html';
import modifypassHtml from 'ngtemplate!html!../../../tpls/user/modifypass.html';
import registerHtml from 'ngtemplate!html!../../../tpls/user/register.html';
import smsaddHtml from 'ngtemplate!html!../../../tpls/user/smsadd.html';
import materialHtml from  'ngtemplate!html!../../../tpls/user/material.html';


UserRouter.$inject = ['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider', '$ocLazyLoadProvider'];
function UserRouter($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider, $ocLazyLoadProvider) {

    //set router
    $urlRouterProvider.otherwise("/login");
    $stateProvider
        // 用户登录
        .state('loginindex', {
            abstract: true,
            url: '',
            data: { 
                pageTitle: '' 
            },
            templateUrl: indexHtml
        })

        // 用户登录
        .state('loginindex.login', {
            url: '/login',
            data: { 
                pageTitle: '登录' 
            },
            templateUrl: loginHtml,
            controller: 'LoginController as vm'
        })

        // 忘记密码
        // .state('loginindex.findpass', {
        //     url: '/findpass',
        //     data: { 
        //         pageTitle: '忘记密码' 
        //     },
        //     templateUrl: findpassHtml,
        //     controller: 'FindpassController as findpass'
        // })

        // // 修改密码
        // .state('modifypass', {
        //     url: '/modifypass',
        //     data: { 
        //         pageTitle: '修改密码' 
        //     },
        //     templateUrl: modifypassHtml,
        //     controller: 'ModifypassController as modifypass'
        // })

        // // 短信充值
        // .state('smsadd', {
        //     url: '/smsadd',
        //     data: { 
        //         pageTitle: '短信充值' 
        //     },
        //     templateUrl: smsaddHtml,
        //     controller: 'SmsAddController as smsadd',
        //     resolve: {
        //         getCompanyList: getCompanyList
        //     }

        // })

        // // 计时设备维护
        // .state('material', {
        //     url: '/material',
        //     data: { 
        //         pageTitle: '计时设备维护' 
        //     },
        //     templateUrl: materialHtml,
        //     controller: 'MaterialController as vm',
        //     resolve: {
        //         getCompanyList: getCompanyList
        //     }

        // })


        // // 用户注册
        // .state('register', {
        //     url: '/register',
        //     data: { 
        //         pageTitle: '用户注册' 
        //     },
        //     templateUrl: registerHtml,
        //     controller: 'RegisterController as register',
        //     resolve: {
        //         loadPlugin: loadPluginFn([loadPlugin.blink])
        //     }
        // });

    // $locationProvider.html5Mode(true);

}

export default UserRouter;